package what.basic.event;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class Jactionlistener {
	JTextField txt=new JTextField(20);	Jactionlistener(){

	JFrame jf=new JFrame("");
		jf.setSize(new Dimension (200,100));
		jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jf.setVisible(true);
		JPanel jp=new JPanel();
		jf.setContentPane(jp);
		jp.add(txt);
		JButton b1=new JButton("queding");
		jp.add(b1);
		ActionListener ac=new ActionHandler();
		b1.addActionListener(ac);
		
	}
	public static void main(String[] args) {
		new Jactionlistener();
	}

}
class ActionHandler implements ActionListener{

	@Override
	public void actionPerformed(ActionEvent e) {
		new Jactionlistener().txt.setText(new Date().toString());
		
	}
	
}
